/// <reference path="../../wx/ad/WxInterstitialAd.ts" />
namespace mgp.ads{
    export class MzInterstitialAd extends WxInterstitialAd{

        protected _getInterstitialAd(id?: string) {
            if (!this._interstitialAd) {
                this._interstitialAd = qg['createInsertAd']({
                    adUnitId: id || this._info.ids[0]
                });
                this._interstitialAd.onError(this._onErr.bind(this))
                this._interstitialAd.onLoad(this._onLoaded.bind(this))
                this._interstitialAd.onClose(this._onClose.bind(this))
            }
            return this._interstitialAd;
        }
        
        protected _canUseInterstitial() {
            return !!qg['createInsertAd'];
        }
    }
}